<% title_tag [@note.title, t('menu.notes')].join(' · ') %>

<div class="row">
  <div class="col-sm-9">
    <div id="notes" class="panel panel-default">
      <div class="panel-heading clearfix">
        <div class="info">
          共 <%= @note.word_count %> <%= t("notes.chars") %>
          • <%= user_name_tag(@note.user) if !owner? @note %>
          <%= l @note.created_at, format: :long %>
          • <%= @note.hits %> <%= t("common.read_times")%>
          • <%= @note.changes_count %> <%= t("notes.times_edit") %>
          <% if owner? @note %>
          <span class="opts pull-right">
            <%= link_to icon_tag("pencil"), edit_note_path(@note),  title: t("common.edit") %>
            <%= link_to icon_tag("trash"), note_path(@note), 'data-confirm' => t("common.confirm_delete"), method: :delete, title: t("common.confirm_delete") %>
          </span>
          <% end %>
        </div>
        <% if @note.publish %>
        <div class="links">
          <label><%= t("notes.page_link")%></label>
          <%= note_url(@note) %>
        </div>
        <% end %>
      </div>
      <div class="panel-body">
        <% if !@note.publish %>
        <i class="fa fa-lock text-success pull-right" title="此内容保密"></i>
        <% end %>
        <div class="markdown">
          <%= markdown(@note.body) %>
        </div>
      </div>
    </div>
  </div>

  <%= render "sidebar" %>
</div>
